program to count the number of digits in a number in java